package com.sharer.last.base.enums;

import lombok.Getter;

/**
 * 站点配置类型
 *
 * @ClassName SiteSettingTypeEnum
 * @Author wangjin
 * @Date 2023/6/17 17:48
 * @Description
 * @Version 1.0
 */
@Getter
public enum SiteSettingTypeEnum {
    /**
     * 基础配置
     */
    BASE_SETTING(1, "base_setting", "基础配置"),
    /**
     * 资料卡
     */
    DATA_CARD(2, "data_card", "资料卡"),
    /**
     * 友链信息
     */
    FRIEND_INFO(3, "friend_info", "友链信息"),
    /**
     * 页脚徽标
     */
    BADGE(4, "badge", "页脚徽标"),
    /**
     * 爱好
     */
    FAVORITE(5, "favorite", "爱好"),
    ;

    private Integer code;

    /**
     * 英文名称
     */
    private String nameEn;

    /**
     * 中文名称
     */
    private String nameZn;

    SiteSettingTypeEnum(int code, String nameEn, String nameZn) {
        this.code = code;
        this.nameEn = nameEn;
        this.nameZn = nameZn;
    }

    public static SiteSettingTypeEnum getTypeEnum(Integer type) {
        for (SiteSettingTypeEnum anEnum : SiteSettingTypeEnum.values()) {
            if (anEnum.getCode().equals(type)) {
                return anEnum;
            }
        }
        return null;
    }
}
